import request from '@/utils/request'
enum  API{
    reqSkuList='/admin/product/list/',
    reqOnSale='/admin/product/onSale/',
    reqCancelSale='/admin/product/cancelSale/',
    reqSkuInfo='/admin/product/getSkuById/',
    reqDelete='/admin/product/deleteSku/'
}
// 获取SKU列表
export const reqSkuList=(page:number,limit:number)=>request.get(API.reqSkuList+`${page}/${limit}`)
// 上线和下线 按钮
export const reqOnSaleOrCancel=(skuId:number,statu:number)=>{
    if(statu==1){
        return request.get(API.reqCancelSale+skuId)
    }else{
        return request.get(API.reqOnSale+skuId)
    }


}
// 获取SKU详情
export const  reqSkuInfo=(skuId:number)=>request.get(API.reqSkuInfo+skuId)
// 删除SKu
export const reqDeleteSku=(skuId:number)=>request.delete(API.reqDelete+skuId)

